<!DOCTYPE html>
<html>
<head>
    <title>Azure POS Data Collection Solution</title>
    <style>
        body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; }
        .question { background: #f5f5f5; padding: 15px; border-radius: 5px; margin-bottom: 20px; }
        .options { margin: 15px 0; }
        .option { margin: 10px 0; }
        button { padding: 8px 15px; background: #0078d4; color: white; border: none; border-radius: 4px; cursor: pointer; }
        .answer { display: none; margin-top: 20px; padding: 15px; background: #e6f2ff; border-radius: 5px; }
        .correct { color: green; font-weight: bold; }
        .incorrect { color: red; }
    </style>
</head>
<body>
    <div class="question">
        <h3>QUESTION NO: 111</h3>
        <p>Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.</p>
        <p>After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.</p>
        
        <p>You are developing an Azure solution to collect point-of-sale (POS) device data from 2,000 stores located throughout the world. A single device can produce 2 megabytes (MB) of data every 24 hours. Each store location has one to five devices that send data.</p>
        
        <p>You must store the device data in Azure Blob storage. Device data must be correlated based on a device identifier. Additional stores are expected to open in the future.</p>
        
        <p>You need to implement a solution to receive the device data.</p>
        
        <p><strong>Solution:</strong> Provision an Azure Event Grid. Configure event filtering to evaluate the device identifier.</p>
        
        <p>Does the solution meet the goal?</p>
        
        <div class="options">
            <div class="option">
                <input type="radio" id="optionA" name="answer" value="A">
                <label for="optionA">A. Yes</label>
            </div>
            <div class="option">
                <input type="radio" id="optionB" name="answer" value="B">
                <label for="optionB">B. No</label>
            </div>
        </div>
        
        <button onclick="showAnswer()">查看答案</button>
        
        <div id="answer" class="answer">
            <p><strong>正确答案：</strong> <span class="correct">B. No</span></p>
            
            <p><strong>解析：</strong></p>
            <ol>
                <li><strong>方案不匹配原因</strong>：
                    <ul>
                        <li>Event Grid设计用于处理<strong>离散事件</strong>（如Blob创建/删除），不适合持续数据流</li>
                        <li>题目场景需要<strong>持续接收设备数据</strong>（每天4-10GB总量），属于数据流而非事件</li>
                        <li>Event Grid无法原生存储数据，必须依赖其他服务处理数据</li>
                    </ul>
                </li>
                
                <li><strong>更合适的方案</strong>：
                    <pre>POS设备 → Azure IoT Hub/Event Hubs → Blob存储
                      ↓
                  设备ID关联处理</pre>
                    <ul>
                        <li>IoT Hub：专为设备数据收集设计，支持设备标识管理</li>
                        <li>Event Hubs：高吞吐量数据摄取，支持按设备ID分区</li>
                    </ul>
                </li>
                
                <li><strong>Event Grid适用场景对比</strong>：
                    <table>
                        <tr>
                            <th>题目需求</th>
                            <th>Event Grid能力</th>
                            <th>匹配度</th>
                        </tr>
                        <tr>
                            <td>全球2000+商店数据收集</td>
                            <td>支持全球分发但非数据收集服务</td>
                            <td class="incorrect">❌</td>
                        </tr>
                        <tr>
                            <td>2MB/设备/天的持续数据</td>
                            <td>设计用于瞬时事件（如Blob创建）</td>
                            <td class="incorrect">❌</td>
                        </tr>
                        <tr>
                            <td>按设备ID关联数据</td>
                            <td>仅支持简单过滤，无数据关联功能</td>
                            <td class="incorrect">❌</td>
                        </tr>
                    </table>
                </li>
            </ol>
            
            <p><strong>官方文档参考：</strong></p>
            <p>
                <a href="https://learn.microsoft.com/en-us/azure/event-grid/overview" target="_blank">Event Grid适用场景</a> |
                <a href="https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/messaging" target="_blank">Azure消息服务选择指南</a>
            </p>
        </div>
    </div>

    <script>
        function showAnswer() {
            document.getElementById('answer').style.display = 'block';
            
            // 显示用户选择
            const selectedOption = document.querySelector('input[name="answer"]:checked');
            if (selectedOption) {
                const userAnswerDiv = document.createElement('div');
                userAnswerDiv.innerHTML = `<p><strong>您的选择：</strong> ${selectedOption.value === 'A' ? '<span class="incorrect">A. Yes</span>' : '<span class="correct">B. No</span>'}</p>`;
                document.getElementById('answer').prepend(userAnswerDiv);
            }
        }
    </script>
</body>
</html>
